<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网格布局-行列属性</title>
    <style>
        .box{
            width: 600px;
            height: 600px;
            border: 5px solid gray;
            display: grid;

            /* 列是宽*行是高 */
            /* 1 固定值 */
            /* grid-template-rows: 200px 200px 200px;
            grid-template-columns: 200px 200px 200px; */
            /* 行列设置相对于容器最好别多也别少 */

            /* 2 百分比 */
            /* grid-template-rows: 33.3% 33.3% 33.3%;
            grid-template-columns: 33.3% 33.3% 33.3%;  */

            /* 3 repeat */
            /* grid-template-rows: repeat(3,33.33%);
            grid-template-columns: repeat(3,33.33%); */
            /* repeat(重复次数，重复数值) */

            /* 4 repeat auto-fill 最方便 */
            /* grid-template-rows: repeat(auto-fill,33.33%);
            grid-template-columns: repeat(auto-fill,33.33%); */

            /* 5 fr 片段 放在中间自适应
            若3个fr 平均分
            1fr 2fr 1fr中间是左右的两倍
            */
            /* grid-template-rows: 1fr 2fr 1fr;
            grid-template-columns: 1fr 2fr 1fr; */

            /* 6 minmax 超出容器自动选min 小于容器自动选max*/
            /* grid-template-rows: minmax(100px,200px) 200px 200px;
            grid-template-columns: 200px 200px 200px; */

            /* 7 auto */
            grid-template-rows:100px auto 200px;
            grid-template-columns:100px auto 200px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
    </div>
</body>
</html>